Skip to content

Red checks take out only what breaks them; lockfiles before a stopped run's pull request; one fault decision for every fix round - #647

Merged
nambok merged 1 commit into
mainfrom
red-ci-ships-with-deferrals
Nov 12, 2026
Merged

nambok merged 1 commit into
mainfrom
red-ci-ships-with-deferrals

Conversation

@nambok

@nambok nambok commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #646. Three ways were left for a run to end badly over red checks or a refused landing:

  1. A dependency fix whose pull request's CI stayed red was taken apart by planned task. Its plan has one task per lockfile, so the revert put a lockfile back without its manifest, and after three reverts the run ended failed with bumps left in the pull request that pass on their own.
  2. A run stopped after its work opened its pull request with the manifests it had changed and lockfiles nobody had written, and waited for CI to fail before they were regenerated.
  3. A review fix or feedback round whose finished work GitHub refused to land was recorded as "didn't finish" at once, while a CI fix round with the same refusal ran again.

Changes

  • Red checks take out only what breaks them
    • A dependency run records each commit of verified bumps (DepRun.commits). When its pull request's CI is red after the fixes, revert_dep_commit puts the branch back to the files before the newest commit, defers that commit's bumps with the cause CI printed, holds their findings out of later bundles, and keeps the commits before it. It does so again while CI stays red and never takes out the last commit. The pull request names each bump under "Deferred".
    • Any other run is taken apart task by task up to eight reverts (three before). CI decides after each; what passes ships with the rest deferred.
    • The run still ends failed, with the exact cause, only when nothing more can come out and the checks are still red. Checks that also fail on the base branch are settled before any fix by the existing rule and never reach this.
  • Lockfiles before a stopped run's pull request: stop_pr::open_with regenerates the lockfiles the branch calls for before it reads the diff or opens the pull request. One that can't be written is named on the run and never stops the pull request.
  • One fault decision for every fix round (round::plan_for_fault, after_fault_parked, keeps_work, start_clean): the CI fix loop, run_fix_round (review fix, security fix, planned work) and the feedback pass all use it. A round that may continue runs again in a fresh step: on its work branch when only the landing failed (a refused push or compare, GitHub not answering), from the pull request's head otherwise. Only a round with no step left is recorded as unfinished.
  • Guard: the supervisor's source scan checks the dependency revert comes before the task revert, that the three round paths use the shared decision, and that the stopped run writes lockfiles before it opens.

Verification

  • cargo test -p worker: 1,615 passed. cargo test -p common --lib dep_fix: 27 passed.
  • cargo clippy -p common -p worker --all-targets -- -D warnings and cargo fmt --check --all: clean.
  • New incident case ag_red_ci_ships_what_passes (4 tests): a dependency run with three sets defers only the newest and names the bump and the failure; a six-task plan is taken apart past the old cap of three down to one task; the stopped run's lockfile step comes before the diff and the pull request; every round kind takes the same decision, keeping its work on a refused push.
  • New dep_fix test for the commit record and take_out_last_commit, including a saved run from before commits were kept.
  • docs/incidents.md has the case's row.

… run's pull request; one fault decision for every fix round

- A dependency fix whose pull request's CI stays red after the fixes
  takes out its newest commit of verified bumps, defers those bumps with
  what CI printed and keeps the commits before it, again while CI stays
  red, never emptying the pull request. It used to be taken apart by
  planned task (one per lockfile), which put a lockfile back without its
  manifest.
- Any other run is taken apart task by task up to eight reverts (three
  before), so the part that passes ships with the rest under Deferred
  instead of the run ending failed with tasks that could still come out.
- A stopped run's lockfiles are written by their package managers before
  its pull request opens or is updated.
- A review fix, security fix, planned-work or feedback round whose
  landing GitHub refuses, or whose pass errors, takes the CI fix round's
  classified decision (round::plan_for_fault): it runs again in a fresh
  step while it may continue, on its work branch when only the landing
  failed and from the pull request's head otherwise.
@nambok
nambok merged commit 9582ee9 into main Nov 12, 2026
10 checks passed
@nambok
nambok deleted the red-ci-ships-with-deferrals branch November 12, 2026 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant